package com.luoqiz.file.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.luoqiz.file.util.aliyun.AliyunOSSUtils;

@RestController
@RequestMapping("/aliyun")
public class AliyunController {

	/**
	 * 阿里雲上传文件临时获取凭证
	 * 
	 * @param callback
	 * @return
	 */
	@GetMapping("/token")
	public String gettoken(String callback) {
		AliyunOSSUtils aliyunOSSUtils = new AliyunOSSUtils();
		return aliyunOSSUtils.getAcessToken(callback, true);
	}
//	@GetMapping("/token1")
//	public void gettoken1(HttpServletRequest request, HttpServletResponse response) {
//		AliyunOSSUtils.getAcessToken(request,response);
//	}
}
